package sdk.weinxin.beans.massmessage;


import sdk.weinxin.beans.massmessage.preview.ImagePreview;
import sdk.weinxin.beans.massmessage.preview.Preview;
import sdk.weinxin.beans.message.Media;

public class MassImageMessage extends MassMessage {

	private Media image;
	public MassImageMessage() {
		super();
		this.setMsgType("image");
	}
	public MassImageMessage(String mediaId) {
		super();
		image = new Media(mediaId);
		this.setMsgType("image");
	}

	public Media getImage() {
		return image;
	}

	public void setImage(Media image) {
		this.image = image;
	}

	@Override
	public Preview convert() {
		Preview preview = new ImagePreview(image.getMediaId());
		if(this.getToUser()!=null && this.getToUser().size()>0){
			preview.setToUser(this.getToUser().iterator().next());
		}
		return preview;
	}
	
}
